package com.easylinkin.linkappapi.knowledgebase.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 知识库表
 * </p>
 *
 * @author xy
 * @since 2021-12-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("linkapp_knowledge_base")
@ApiModel("知识库(KnowledgeBase)实体类")
public class KnowledgeBase extends Model<KnowledgeBase> {

  private static final long serialVersionUID = 1L;

  /**
   * 主键(自增)
   */
  @ApiModelProperty("主键(自增)")
  @TableId(value = "id_", type = IdType.AUTO)
  private Long id;

  /**
   * 租户id
   */
  @ApiModelProperty("租户id")
  @TableField("tenant_id")
  private String tenantId;

  /**
   * 名称
   */
  @ApiModelProperty(value = "名称", required = true)
  @TableField("name_")
  private String name;

  /**
   * 知识类别 多选
   */
  @ApiModelProperty(value = "知识类别 多选", required = true)
  @TableField("types_")
  private String types;

  /**
   * 内容
   */
  @ApiModelProperty(value = "内容", required = true)
  @TableField("content_")
  private String content;

  /**
   * 附件列表
   */
  @ApiModelProperty("附件列表")
  @TableField(value = "attachments_",updateStrategy = FieldStrategy.IGNORED)
  private String attachments;

  /**
   * 附件列表
   */
  @ApiModelProperty("附件列表")
  @TableField(value = "attachments_zip_url",updateStrategy = FieldStrategy.IGNORED)
  private String attachmentsZipUrl;

  /**
   * 访问权限：0全体 1指定用户 2仅创建人
   */
  @ApiModelProperty(value = "访问权限：0全体 1指定用户 2仅创建人", required = true)
  @TableField("permission_scope_")
  private Integer permissionScope;

  /**
   * 可见用户(用户ID，逗号分隔) 访问权限为1
   */
  @ApiModelProperty("可见用户(用户ID，逗号分隔) 访问权限为1 ")
  @TableField("permission_users_")
  private String permissionUsers;

  @ApiModelProperty("创建人id")
  @TableField("creator_id_")
  private String creatorId;

  @ApiModelProperty("创建人")
  @TableField("creator_")
  private String creator;

  @ApiModelProperty("创建时间")
  @TableField("create_time_")
  private Date createTime;

  @ApiModelProperty("修改人")
  @TableField("modifier_")
  private String modifier;

  @ApiModelProperty("修改时间")
  @TableField("modify_time_")
  private Date modifyTime;

  /**
   * 类型 请求参数
   */
  @ApiModelProperty("类型 请求参数")
  @TableField(exist = false)
  private Long type;

  /**
   * userId 请求参数
   */
  @ApiModelProperty("userId 请求参数")
  @TableField(exist = false)
  private Long userId;

  @Override
  protected Serializable pkVal() {
    return this.id;
  }

}
